.\" SPDX-License-Identifier: CC-BY-SA-4.0 or-later
.\" SPDX-FileCopyrightText: 2025 grommunio GmbH
.TH timer 8gx "" "Gromox" "Gromox admin reference"
.SH Name
\fBtimer\fP \(em deferred command executor
.SH Synopsis
\fBtimer\fP [\fB\-c\fP \fIconfig\fP]
.SH Description
The timer daemon can be used to schedule commands to be executed once, at a
particular time in the future. It is similar to the at(1) command and its
associated daemon, atd.
.PP
timer(8gx) generally receives commands from timer_agent(4gx).
.SH Options
.TP
\fB\-c\fP \fIconfig\fP
Read configuration directives from the given file. If this option is not
specified, /etc/gromox/timer.cfg will be read if it exists.
.TP
\fB\-\-version\fP
Output version information and exit.
.TP
\fB\-?\fP
Display option summary.
.PP
All time-based command-line options and configuration file directives are
subject to the syntax described in gromox(7), section "Duration
specifications".
.SH Files
.IP \(bu 4
/var/lib/gromox/timer.txt: This file is used to save the state of timer(8gx)
and persist them across restarts.
.SH Configuration directives
The usual config file location is /etc/gromox/timer.cfg.
.TP
\fBrunning_identity\fP
An unprivileged user account to switch the process to after startup.
To inhibit the switch, assign the empty value.
.br
Default: \fIgromox\fP
.TP
\fBtimer_hosts_allow\fP
A space-separated list of individual IPv6 or v4-mapped IPv6 host addresses that
are allowed to converse with the timer service. No networks and no CIDR
notations are permitted.
.br
Default: \fI::1\fP
.TP
\fBtimer_listen_ip\fP
An IPv6 address (or v4-mapped address) for exposing the timer service on.
.br
Default: \fI::1\fP
.TP
\fBtimer_listen_port\fP
The TCP port number for exposing the timer service on.
.br
Default: \fI6666\fP
.TP
\fBtimer_log_file\fP
Target for log messages here. Special values: "\fI-\fP" (stderr/syslog
depending on parent PID) or "\fIsyslog\fP" are recognized.
.br
Default: \fI-\fP (auto)
.TP
\fBtimer_log_level\fP
Maximum verbosity of logging. 1=crit, 2=error, 3=warn, 4=notice, 5=info, 6=debug.
.br
Default: \fI4\fP (notice)
.TP
\fBtimer_state_path\fP
Default: \fI/var/lib/gromox/timer.txt\fP
.TP
\fBtimer_threads_num\fP
The minimum number of client processing threads to keep around.
.br
Default: \fI50\fP
.SH Timer protocol
The timer service is exposed as a line-based text protocol. Upon connection,
the event server gratitiously writes "OK", following which the server will wait
for timer commands, and execute them synchronously.
.PP
The command "ADD <seconds> <command>" installs a new timer for the given command
to be executed in that many seconds from now. The server will respond with
"FALSE 2", "FALSE 3", or respond with the timer ID as "TRUE <id>".
.PP
The command "CANCEL <id>" revokes the timer with the chosen ID.
.SH See also
\fBgromox\fP(7), \fBtimer_agent\fP(4gx)
